const Router = require('koa-router')
const {videoDetail} = require('../json/json')


const router = new Router({
  prefix:'/sjj'
})

router.get('/v1', async (ctx, next) => {

  // body: ctx.request.body,
  // query: ctx.request.query, // get传参
  // path: ctx.params,
  // header: ctx.request.header
  // console.log(ctx.request.query)
  const ids = ctx.request.query.id
  console.log(ids)

  ctx.body = videoDetail[ids]
})
router.post('/v2', async (ctx, next) => {

  ctx.body = {
    key: 'fhfhgjgj'
  }
})

module.exports = router